package com.example.springbootdemo.controller;

import com.example.springbootdemo.entity.Dept;
import com.example.springbootdemo.service.DeptService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DeptController {
    @Resource
    private DeptService deptService;

    @GetMapping("dept")
    public List<Dept> findAll(){
        return deptService.findAll();
    }

/*    @GetMapping("dept")
    public boolean insert(Dept dept, HttpSession session){
//        Dept dept1 = (Dept) session.getAttribute("dept");

        return deptService.insert();
    }*/
}
